package com.telnetnz.ticketdesk.dao.wrapper;

import java.util.List;

import net.sf.ehcache.Cache;

import com.rockbb.common.dao.CacheManagerBean;
import com.telnetnz.ticketdesk.dao.entity.TemplateEntity;
import com.telnetnz.ticketdesk.dao.mapper.TemplateMapper;

public class TemplateWrap
{
	private TemplateMapper mapper;
	private Cache cache;

	public TemplateWrap(TemplateMapper mapper, CacheManagerBean cacheManagerBean)
	{
		this.mapper = mapper;
		this.cache = cacheManagerBean.get(mapper.getClass().getName());
	}

	public TemplateEntity select(int id)
	{
		return mapper.select(id);
	}

	public long countAll()
	{
		return mapper.countAll();
	}

	public void insert(TemplateEntity entity)
	{
		mapper.insert(entity);
	}

	public void delete(TemplateEntity entity)
	{
		mapper.delete(entity);
	}

	public void update(TemplateEntity entity)
	{
		mapper.update(entity);
	}

	public TemplateEntity selectByName(String name)
	{
		return mapper.selectByName(name);
	}

	public List<TemplateEntity> selectByType(int type)
	{
		return mapper.selectByType(type);
	}

	public List<TemplateEntity> selectAll()
	{
		return mapper.selectAll();
	}

	public Cache getCache()
	{
		return cache;
	}
}
